package com.lldpet.spring.cloud.demo.price.service.config;

import com.lldpet.spring.cloud.demo.price.client.event.LocalApplicationEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;

/**
 * @desc：LocalEventConfiguration
 * @author: guanliang.xue
 * @date: 2021/5/10 13:17
 * @version:
 * @since:
 */
@Configuration
public class LocalEventConfiguration {
    Logger logger = LoggerFactory.getLogger(LocalEventConfiguration.class);

    @EventListener
    public void onLocalEvent(LocalApplicationEvent localApplicationEvent){
        logger.info("监听spring 本地事件: {} , 接收到消息: {}", localApplicationEvent.getName(), localApplicationEvent.getSource());
    }
}
